<?php
	require_once('../inc/fen_fns.php');
	
	if ($_POST['id'])
	{
		$id = $_POST['id'];
		
		$query = $_DB->Query("SELECT * from fen_department WHERE faculty_id = '".$id."' ORDER BY department_name ASC");
		$count = $_DB->GetResultNumber($query);
		
		echo "<option value=\"\">Tüm Bölümler</option>";
		
		for ($i=0; $i<$count; $i++)
		{	
			echo "<option value=\"".$_DB->GetResultValue($query, $i, "id")."\">".$_DB->GetResultValue($query, $i, "department_name")."</option>";
		}
		
	}
?>